# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=shed
_pkgname=Shed
pkgver=2.0.0
pkgrel=1
pkgdesc='.NET runtime inspector.'
arch=('any')
groups=('blackarch' 'blackarch-windows' 'blackarch-reversing')
url='https://github.com/enkomio/shed/releases'
license=('custom:unknown')
depends=('wine-mono' 'lib32-gnutls')
source=("https://github.com/enkomio/$pkgname/releases/download/$pkgver/$_pkgname.$pkgver.zip")
sha512sums=('079c4a6701e63d68eb509f9997cac37bce462bb0b6b0517508b1f90ae9c2750490d2d3911e2f52839ab5caeee704c631f7beba7583833eb3dbc72578dcbd3152')

package() {
  cd $_pkgname

  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/windows/$pkgname/"

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/windows/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/windows/$pkgname
exec wine $_pkgname.exe "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

